package com.example.selfservicestation.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.example.selfservicestation.activity.MainActivity

/**
 * 开机自启
 */
class Bootstrapper : BroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent) {
        if (Intent.ACTION_BOOT_COMPLETED == intent.action) {
            context.startActivity(
                Intent(context, MainActivity::class.java)
                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            )
        }
    }

}